<?php
session_start();
$db = require 'db.php';

foreach($db as $d)
{
	if($d['username']==$_POST['username']
		&& $d['password']==$_POST['password'])
	{
		//标识登录成功
		$_SESSION['dsfksdkl']=true;
		header('location:admin.php');
		exit;
	}
}
header("location:index.php");
